#ifndef BOOKPAGE_H
#define BOOKPAGE_H

#include <QtGui/QWidget>
#include <QGridLayout>
#include <QPrinter>
#include <QWebFrame>
#include <QPrintPreviewDialog>
#include <QPrintPreviewWidget>
#include <QWebView>
#include <QPrintDialog>
#include <QUrl>
#include <QTextStream>
#include <QFile>
#include "util.h"

namespace Ui {
    class BookPage;
}

class BookPage : public QWidget {
    Q_OBJECT
public:
    BookPage(QWidget *parent = 0);
    ~BookPage();
    void load(const QString &url,int page);
    QString loadFile(const QString &url);
    void preview();
protected:
    void changeEvent(QEvent *e);

private:
    Ui::BookPage *m_ui;
    QWebView* webView;
    QGridLayout *mainLayout;
private slots:
    void printPreview(QPrinter *printer);
};

#endif // BOOKPAGE_H
